﻿using CloudFranceTriple.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace CloudFranceTriple.Tests.Areas.Forum
{
    [TestClass]
    public class UnreadMessageControllerTest : UnitTestBase
    {
        [TestMethod]
        [TestCategory("Forum.UnreadMessage")]
        public void UnreadMessageController_ShowUnreadMessage()
        {
            // Arrange
            var controller = new CloudFranceTriple.WebRole.Areas.Forum.Controllers.UnreadMessageController(GetWebSecurity.Object);

            controller.ControllerContext = base.GetControllerContext.Object;

            var context =
                new Mock<HttpContextBase>(MockBehavior.Strict);

            controller.Url =
                new UrlHelper(new RequestContext(context.Object,
                new RouteData()), new RouteCollection());

            // Act
            var result = controller.ShowUnreadMessage() as PartialViewResult;

            // Assert
            Assert.IsNotNull(result);
        }

        [Ignore]
        [TestProperty("Cost", "TooExpensive")]
        [TestMethod]
        [TestCategory("Forum.UnreadMessage")]
        public void UnreadMessageController_MarkAllPostAsReadAsync()
        {
            // Arrange
            var controller = new CloudFranceTriple.WebRole.Areas.Forum.Controllers.UnreadMessageController(GetWebSecurity.Object);

            controller.ControllerContext = base.GetControllerContext.Object;

            var context =
                new Mock<HttpContextBase>(MockBehavior.Strict);

            controller.Url =
                new UrlHelper(new RequestContext(context.Object,
                new RouteData()), new RouteCollection());

            // Act
            controller.MarkAllPostAsReadAsync();

            // Assert
            Assert.IsTrue(false);
        }

    }
}
